/**  

* @author wangyue  

* @date 2018年8月4日  

*/
package pro.wy.test.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/restTemplateController")
public class RestTemplateController {
	@Bean
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}

	@Autowired
	private RestTemplate restTemplate;

	@RequestMapping("/test")
	public List<String> test() {
		return restTemplate.getForObject("http://127.0.0.1:8080/restTemplateController2/test2", List.class);

	}

}